@extends('backend.layouts.main-iframe')
@section('content')
<div class="col-md-6">
    <div class="box box-primary">
        <form method="POST" action="{{URL('admin/role')}}">
            {{ csrf_field() }}
            <div class="box-body">
                <div class="form-group">
                    <label for="inputWarning">角色名称</label>
                    <input type="text" class="form-control" name="role_name" placeholder="请输入角色名称" value="{{ old('role_name')}}">
                    @if ($errors->has('role_name'))
                    <span class="help-block">
                        <strong style="color: #a94442;">{{ $errors->first('role_name') }}</strong>
                    </span>
                    @endif
                </div>
                <div class="form-group">
                    <label for="inputWarning">角色说明</label>
                    <input type="text" class="form-control" name="role_explain" placeholder="请输入角色说明" value="{{ old('role_explain')}}">
                    @if ($errors->has('role_explain'))
                    <span class="help-block">
                        <strong style="color: #a94442;">{{ $errors->first('role_explain') }}</strong>
                    </span>
                    @endif
                </div>
                <div class="form-group">
                    <label for="inputWarning">权限</label>
                    <div class="checkbox">
                        @foreach($permissionDatas AS $permissionData)
                        <label> <input type="checkbox" name="permission[]" value="{{$permissionData->id}}"> {{$permissionData->permissions_name}}</label>
                        @endforeach
                    </div>
                    @if ($errors->has('permission'))
                    <span class="help-block">
                        <strong style="color: #a94442;">{{ $errors->first('permission') }}</strong>
                    </span>
                    @endif
                </div>
            </div>
            <div class="box-footer">
                <button type="submit" class="btn btn-primary">提交</button>
            </div>
        </form>
    </div>
</div>
@endsection